﻿@section header
{
<link href="@Url.Content("~/Content/Online/Kanban.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/Online/BusinessProvider/fKanban.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Online/BusinessProvider/fKanban.goal.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Online/BusinessProvider/fKanban.task.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Utility/Index.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Online/Kanban.js")" type="text/javascript"></script>
}
@Html.Partial("GoalAddControl")
@Html.Partial("TaskAddControl")
<table class="Kanban">
    <tr class="kanban-header">
        <td class="kanban-header-goal"><a href="javascript:;" title="点击添加新目标Goal" class="jAddNewItem" data-value="goal-add-panel">+目标Goal</a></td>
        <td class="kanban-header-todo">未开始To do</td>
        <td class="kanban-header-doing">进行中Doing</td>
        <td class="kanban-header-done">已完成Done</td>
    </tr>
    @{
        var goalList = ViewData["goals"] as List<fKanban.Model.SprintGoalEntity>;
        if (goalList != null && goalList.Count > 0)
        {
            foreach (var goalItem in goalList)
            {
    <tr class="kanban-box" id="sprint_goal_@{@goalItem.Id}">
        <td class="kanban-row-goal" data-value="0">
            <div class="goal-item" data-id="@goalItem.Id">
                <div class="goal-item-header">
                    <a href="javascript:;" title="点击编辑该项" id="modify_goal_@{@goalItem.Id}">@goalItem.Name</a>
                    <span class="lDuration">[@{@goalItem.Duration}/@ViewData["totalDuration"]h]</span>
                </div>
                <div class="goal-item-content" id="content@{@goalItem.Id}">@goalItem.Description</div>
                <div class="goal-item-manage">
                <a href="javascript:;" id="remove_goal_@{@goalItem.Id}" class="_hidden">删除</a>
                <a href="javascript:;" id="remove_goal_confirm_@{@goalItem.Id}" class="_hidden">确定</a>
                <a href="javascript:;" id="remove_goal_cancel_@{@goalItem.Id}" class="_hidden">取消</a>
                <a href="javascript:;" title="点击添加新任务" class="addTask" data-value="@goalItem.Id">+任务Task</a></div>
            </div>
        </td>
        <td class="kanban-row-todo" id="kanban_row_todo_@{@goalItem.Id}" data-value="1">
    @{
                if (null != goalItem.Todos && goalItem.Todos.Count > 0)
                {
                    foreach (var todo in goalItem.Todos)
                    {
                        @Html.Partial("KanbanItemTemplateControl", todo)
                    }
                }
    }
        </td>
        <td class="kanban-row-doing" id="kanban_row_doing_@{@goalItem.Id}" data-value="2">
    @{
                if (null != goalItem.Doings && goalItem.Doings.Count > 0)
                {
                    foreach (var doing in goalItem.Doings)
                    {
                        @Html.Partial("KanbanItemTemplateControl", doing)
                    }
                }
    }
        </td>
        <td class="kanban-row-done" id="kanban_row_done_@{@goalItem.Id}" data-value="3">
    @{
                if (null != goalItem.Dones && goalItem.Dones.Count > 0)
                {
                    foreach (var done in goalItem.Dones)
                    {
                        @Html.Partial("KanbanItemTemplateControl", done)
                    }
                }
    }
        </td>
    </tr>
            }
        }
}
</table>